package com.softa.common.service;

import com.softa.common.entity.SysResource;
import com.softa.common.sysconfig.support.DataTableRequest;
import com.softa.common.sysconfig.support.Tree;

import java.util.List;
import java.util.Map;
import java.util.Set;


/**
 * @author hasee
 */
public interface ResourceService {


	String createResource(SysResource resource);

	String updateResource(SysResource resource);

    void deleteResource(Long resourceId);

    SysResource findOne(Long resourceId);

    List<SysResource> findAll();

    /**
     * 得到资源对应的权限字符串
     * @param resourceIds
     * @return
     */
    Set<String> findPermissions(Set<Long> resourceIds);

    /**
     * 根据用户权限得到菜单
     * @param permissions
     * @return
     */
    List<SysResource> findMenus(Set<String> permissions);
    
    Map<String,Object> queryResourceByParam(DataTableRequest request);
    
    List<Tree> ajaxResourceTree();
    
    List<Tree> findMenuResourceTree(String username);

    Set<String> findAllPermissions();
}
